]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Bug 594184 - Fix up glow positioning logic
authorColin Walters <walters@verbum.org>
Fri, 4 Sep 2009 23:58:37 +0000 (19:58 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Sat, 5 Sep 2009 00:03:56 +0000 (20:03 -0400)
We were allowing the glow allocation to go too far to the right;
clean up the logic.

js/ui/appIcon.js

index 5e68839cdb0c63a0cac943cd59fccd44918ba7c0..46bce10bf788701dd454d3cd6d5a13492e709709 100644 (file)
@@ -89,10 +89,10 @@ AppIcon.prototype = {
         let targetWidth = availWidth;
         let xPadding = 0;
         if (naturalWidth < availWidth) {
-            xPadding = (availWidth - naturalWidth) / 2;
+            xPadding = Math.floor((availWidth - naturalWidth) / 2);
         }
-        childBox.x1 = Math.floor(xPadding);
-        childBox.x2 = availWidth;
+        childBox.x1 = xPadding;
+        childBox.x2 = availWidth - xPadding;
         childBox.y1 = GLOW_PADDING_VERTICAL;
         childBox.y2 = availHeight - GLOW_PADDING_VERTICAL;
         this._name.allocate(childBox, flags);
@@ -101,7 +101,8 @@ AppIcon.prototype = {
 
         if (this._glowBox != null) {
             let glowPaddingHoriz = Math.max(0, xPadding - GLOW_PADDING_HORIZONTAL);
-            childBox.x1 = Math.floor(glowPaddingHoriz);
+            glowPaddingHoriz = Math.max(GLOW_PADDING_HORIZONTAL, glowPaddingHoriz);
+            childBox.x1 = glowPaddingHoriz;
             childBox.x2 = availWidth - glowPaddingHoriz;
             childBox.y1 = 0;
             childBox.y2 = availHeight;